home *** CD-ROM | disk | FTP | other *** search
- function setup()
- {
- myFlag = 0;
- Counter = -1;
- totalFileSize = _root.getBytesTotal();
- startBytes = _root.getBytesLoaded();
- tickerStartLocationX = _root.theTicker._x;
- tickerStartLocationY = _root.theTicker._y;
- _global.up = 87;
- _global.down = 83;
- _global.rightward = 68;
- _global.leftward = 65;
- _global.jump = 32;
- _global.hotKey_up = _global.up;
- _global.hotKey_down = _global.down;
- _global.hotKey_left = _global.leftward;
- _global.hotKey_right = _global.rightward;
- _global.hotKey_jump = _global.jump;
- _root.crosshair.cacheAsBitmap = true;
- Mouse.hide();
- _global.FPSforTweenClass = 45;
- _global.trailOn = true;
- _global.soundOn = true;
- _global.musicOn = true;
- _global.myMusicPlayer = new Music();
- _global.SoundManager = new SoundPlayer();
- }
- function run()
- {
- mouseCurserAdjust();
- preloaderStuff();
- rotateAvatar();
- }
- function preloaderStuff()
- {
- if(Counter == -1)
- {
- bytesLoaded = _root.getBytesLoaded();
- amountLoaded = bytesLoaded / totalFileSize;
- myPercentLoaded = int(100 * amountLoaded);
- _root.preload_txt.text = myPercentLoaded + "%";
- tickerX = tickerStartLocationX + myPercentLoaded * 2;
- moveTicker(_root.theTicker,tickerX,tickerStartLocationY);
- if(amountLoaded >= 1 && myFlag == 0)
- {
- myFlag = 1;
- Counter = 30;
- if(_global.latestLevel != 0)
- {
- Counter = 0;
- }
- }
- }
- else if(Counter == 0)
- {
- okToPlay = true;
- siteURL = "http://www.herointeractive.com";
- siteURL2 = "http://herointeractive.com";
- if(_url.substr(0,siteURL.length) == siteURL || _url.substr(0,siteURL2.length) == siteURL2)
- {
- okToPlay = true;
- }
- if(okToPlay)
- {
- if(_global.latestLevel == 0)
- {
- _root.gotoAndPlay("loadSounds");
- }
- else
- {
- _root.gotoAndPlay("loadSounds");
- }
- }
- }
- else
- {
- Counter--;
- }
- }
- function moveTicker(mc, xVal, yVal)
- {
- var _loc5_ = xVal;
- var _loc6_ = yVal;
- var _loc3_ = 0.00009;
- var _loc4_ = _global.FPSforTweenClass;
- var _loc7_ = mc._x;
- var _loc8_ = mc._y;
- myTweening = new mx.transitions.Tween(mc,"_x",mx.transitions.easing.Strong.easeOut,_loc7_,_loc5_,_loc3_,true);
- myTweening = new mx.transitions.Tween(mc,"_y",mx.transitions.easing.Strong.easeOut,_loc8_,_loc6_,_loc3_,true);
- myTweening.FPS = _loc4_;
- myTweening.FPS = _loc4_;
- myTweening.onMotionFinished = function()
- {
- };
- }
- function rotateAvatar()
- {
- var _loc2_ = new Vector();
- _loc2_._x = _xmouse - _root.pointer._x;
- _loc2_._y = _ymouse - _root.pointer._y;
- var _loc3_ = Math.atan2(_loc2_._y,_loc2_._x);
- var _loc4_ = 360 * _loc3_ / 6.283185307179586;
- _root.pointer._rotation = _loc4_;
- }
- function mouseCurserAdjust()
- {
- _root.crosshair._x = _xmouse;
- _root.crosshair._y = _ymouse;
- }
- function OpenArmorGames()
- {
- getUrl("http://www.armorgames.com", "_blank");
- }
- function OpenHeroInteractive()
- {
- getUrl("http://www.herointeractive.com", "_blank");
- }
- stop();
- _root.kongregateServices.connect();
- var myFlag;
- var Counter;
- var totalFileSize;
- var startBytes;
- var tickerStartLocationX;
- var tickerStartLocationY;
- var tickerX;
- _global.dataVector = new DataObject();
- _global.dataVector.mSet(9282);
- var additionalMenu = new ContextMenu();
- additionalMenu.hideBuiltInItems();
- var NewItem = new ContextMenuItem("Play More Games!",OpenArmorGames);
- additionalMenu.customItems.push(NewItem);
- NewItem = new ContextMenuItem("This Game Developed by Hero Interactive",OpenHeroInteractive);
- additionalMenu.customItems.push(NewItem);
- _root.menu = additionalMenu;
-